Conversation
Walkthroughμ΄λ² λ³κ²½μμλ μΉ΄λ μ΄λ μ optimistic updateμ totalCount μΌκ΄μ± κ°μ , λͺ¨λ¬ μ€λ²λ μ΄ ν΄λ¦ μ΄λ²€νΈ μ ν λ°©μ§, μ£Όμ μ κ±°, κ·Έλ¦¬κ³ ν μ€νΈμ© νμ΄μ§ νμΌ μμ κ° μ΄λ£¨μ΄μ‘μ΅λλ€. μ 체μ μΌλ‘ UIμ μΊμ μν λκΈ°ν κ΄λ ¨ μ½λκ° μ λλμμ΅λλ€. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ModalOverlay
participant ModalContent
User->>ModalOverlay: Click overlay
ModalOverlay->>ModalOverlay: onClick (e.stopPropagation)
ModalOverlay--x ModalContent: μ΄λ²€νΈ μ ν μ°¨λ¨
sequenceDiagram
participant User
participant Column
participant useCardMutation
participant Cache
User->>Column: μΉ΄λ λλκ·Έ μ΄λ
Column->>useCardMutation: μΉ΄λ μ΄λ mutate νΈμΆ
useCardMutation->>Cache: μ΄μ 컬λΌμμ μΉ΄λ μ κ±°, totalCount -1
useCardMutation->>Cache: μ 컬λΌμ μΉ΄λ μΆκ°, totalCount +1
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. π§ ESLint
npm error Exit handler never called! β¨ Finishing Touches
πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
π Outside diff range comments (1)
src/app/features/dashboard_Id/api/useCardMutation.ts (1)
104-112: λ‘€λ°± λ‘μ§μ νμ λΆμΌμΉ λ¬Έμ μμ νμλ‘€λ°± λ‘μ§μμ νμ λΆμΌμΉ λ¬Έμ κ° μμ΅λλ€. λκ΄μ μ λ°μ΄νΈμμλ
InfiniteData<CardResponse>νμ μ μ¬μ©νμ§λ§, λ‘€λ°±μμλCardResponseνμ μΌλ‘ μ€μ νκ³ μμ΅λλ€.-onError: (error, variables, context) => { - if (context?.previousData) { - queryClient.setQueryData<CardResponse>( - ['columnId', variables.columnId], - context.previousData, - ) - } - console.error('μΉ΄λ μ΄λ μ€ν¨:', error) -}, +onError: (error, variables, context) => { + if (context?.previousData) { + queryClient.setQueryData<InfiniteData<CardResponse>>( + ['columnId', variables.columnId], + context.previousData, + ) + } + // μ΄μ 컬λΌλ λ‘€λ°±ν΄μΌ νλμ§ κ³ λ € νμ + const currentCard = useDragStore.getState().draggingCard + if (currentCard && context?.previousPrevColumnData) { + queryClient.setQueryData<InfiniteData<CardResponse>>( + ['columnId', currentCard.cardData.columnId], + context.previousPrevColumnData, + ) + } + console.error('μΉ΄λ μ΄λ μ€ν¨:', error) +},λν μ΄μ 컬λΌμ λ°μ΄ν°λ λ‘€λ°± 컨ν μ€νΈμ μ μ₯νκ³ λ³΅μνλ κ²μ κ³ λ €ν΄λ³΄μΈμ.
π§Ή Nitpick comments (1)
src/app/features/dashboard_Id/Card/cardFormModals/CreateCardModal.tsx (1)
16-19: λͺ¨λ¬ UX κ°μ μ μν μ μνμ¬ λͺ¨λ¬ μ€λ²λ μ΄μμ μ΄λ²€νΈ μ νλ§ μ°¨λ¨νκ³ μλλ°, μΌλ°μ μΌλ‘ μ¬μ©μλ λͺ¨λ¬ λ°°κ²½μ ν΄λ¦νμ λ λͺ¨λ¬μ΄ λ«νκΈ°λ₯Ό κΈ°λν©λλ€. UX ν₯μμ μν΄ λ€μκ³Ό κ°μ΄ κ°μ νλ κ²μ κ³ λ €ν΄λ³΄μΈμ:
+interface ModalProps { + children: React.ReactNode + onClose?: () => void +} -export default function CreateCardModal({ children }: ModalProps) { +export default function CreateCardModal({ children, onClose }: ModalProps) { // ... return createPortal( <div className="z-60 fixed inset-0 flex items-center justify-center bg-black/40" - onClick={(e) => e.stopPropagation()} + onClick={(e) => { + e.stopPropagation() + onClose?.() + }} > - <div className="BG-white h-970 w-584 overflow-y-scroll rounded-16 p-32 shadow-lg [mask-image:radial-gradient(white_100%,transparent_100%)] mobile:h-766 mobile:w-327 mobile:px-16 mobile:py-24"> + <div + className="BG-white h-970 w-584 overflow-y-scroll rounded-16 p-32 shadow-lg [mask-image:radial-gradient(white_100%,transparent_100%)] mobile:h-766 mobile:w-327 mobile:px-16 mobile:py-24" + onClick={(e) => e.stopPropagation()} + > {children} </div> </div>,
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (4)
src/app/features/dashboard_Id/Card/cardFormModals/CreateCardModal.tsx(1 hunks)src/app/features/dashboard_Id/Column/Column.tsx(0 hunks)src/app/features/dashboard_Id/api/useCardMutation.ts(3 hunks)src/app/tester/page.tsx(0 hunks)
π€ Files with no reviewable changes (2)
- src/app/features/dashboard_Id/Column/Column.tsx
- src/app/tester/page.tsx
π Additional comments (2)
src/app/features/dashboard_Id/api/useCardMutation.ts (2)
54-54: μ£Όμ κ°μ μ΄ μ’μ΅λλ€μ£Όμμ΄ λ λͺ ννκ³ κ΅¬μ²΄μ μΌλ‘ λ³κ²½λμ΄ μ½λ κ°λ μ±μ΄ ν₯μλμμ΅λλ€.
69-69: totalCount λκΈ°ν κ°μ μ΄ νλ₯ν©λλ€λκ΄μ μ λ°μ΄νΈμμ totalCountλ₯Ό μ μ ν μ¦κ°μμΌ μΊμ μΌκ΄μ±μ μ μ§νλ κ°μ μ¬νμ΄ λ§€μ° μ’μ΅λλ€. μ΄λ 무ν μ€ν¬λ‘€μ΄λ νμ΄μ§λ€μ΄μ μμ λ°μν μ μλ λ°μ΄ν° λΆμΌμΉ λ¬Έμ λ₯Ό λ°©μ§ν©λλ€.
Also applies to: 88-88
π λ³κ²½ μ¬ν κ°μ
π‘ μ°Έκ³ μ¬ν
Summary by CodeRabbit
λ²κ·Έ μμ
μ 리